<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 


<h:head>
	<title>Prosperous</title>
	<link rel="stylesheet" href="../../../resources/styles/layout.css" type="text/css"/>
	
</h:head>


<h:body>
	<h:form id="form1">
	<div class="wrapper row1">
	  <header id="header" class="clear">
	    <hgroup>
	      <h1><a href="index.html">Cardápio Mobile</a></h1>
	      <h2>Seu cardápio para o mundo todo </h2>
	    </hgroup>
			<fieldset class="fl_right">
		    	<p:panel style="width:300px;height:50px;right:200px;top:60px;background:#696969;border:1px solid black">  
			    	<h:outputLabel style="font-weight:bold;color:#FFFFE0;" value="Usuário:"/>
					<h:outputLabel style="font-weight:bold;color:#FFA500;" value="#{loginMB.getSessao('NomeUsuario')}"/>  
					<fieldset>		
						<h:outputLabel value="Acesso: " style="font-weight:bold;color:#FFFFE0;"/>  
						<h:outputText id="restaurante" style="font-weight:bold;color:#FFA500;" value="#{loginMB.getSessao('NomeFantasia')}"/>
						
						<p:spacer width="75" height="13"/>                                  

						<p:commandButton id="btnNoticia" type="button" icon="ui-iconNews" style="width:25px;height:25px;background:#696969" rendered="#{portalCardapioMB.statusPlanoVencendo}" /> 
						<p:menu overlay="true" trigger="btnNoticia" my="left top" at="left bottom" style="width:300px;height:30px"> 
								<p:menuitem value="#{contratoMB.msgPlanoVencendo}" 
								style="background:#F5F5F5;color: red;font-size:13px;font-weight:bold;" />
						</p:menu>
						
					</fieldset>  
				</p:panel> 
			</fieldset>
			<fieldset>
			<p></p>
			</fieldset>
			
	    <nav class="clear">
	      <ul>

	        <li class="active"><a href="#">Minha Conta</a>
	          <ul>
	            <li><a href="portalCardapioMundo.jsf">Portal Home</a></li>
	            <li><a href="../user/meusDados.jsf">Meus Dados</a></li>
	            <li><a href="portalCardapioMundo.jsf?changeAccess=EEN013550">Trocar Acesso</a></li>
	            <li onclick="PF('dlgSair').show();"><a href="#">Sair</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Acesso</a>
	          <ul>
	            <li><a href="../admin/cadUsuario.jsf">Novo Usuário</a></li>
	            <li><a href="../user/consUsuario.jsf">Consulta Usuários</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>
	        
	        <li><a href="#">Restaurante</a>
	          <ul>
	            <li><a href="../admin/cadRestauranteFilial.jsf?operation=ADDFILIAL">Nova Filial</a></li>
	            <li><a href="../user/consRestaurante.jsf?operation=ALTRESTAURANTE">Consulta Restaurante</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Cardápio</a>
	          <ul>
	            <li><a href="../user/cardapio/opcaoCardapios.jsf">Novo Cardápio</a></li>
	            <li><a href="../user/cardapio/consCardapios.jsf">Cardápios</a></li>
	            <li><a href="../user/cardapio/consCardapios.jsf">Agendamento</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Business Intelligence</a>
	          <ul>
	            <li><a href="#">Avaliações Cardápio</a></li>
	            <li><a href="#">Avaliações Atendimento</a></li>
	            <li><a href="#">Avaliações Infraestrutura</a></li>
	            <li><a href="#">Avaliação Geral</a></li>
	            <li><a href="#"></a></li>
	          </ul>
	        </li>

	        <li><a href="#">Pagamento</a>
	          <ul>
	            <li><a href="#">Meus Pagamentos</a></li>
	          </ul>
	        </li>

	        <li><a href="#">Plano</a>
	          <ul>
	            <li><a href="#">Meu Plano</a></li>
	            <li><a href="#">Renovação</a></li>
	            <li><a href="#">Novos Planos</a></li>
	          </ul>
	        </li>
	        
	      </ul>
	    </nav>
	  </header>
	</div>
 
</h:form>  	    			
	
	
	<h:form id="form2">

	<div class="wrapper row2">
	    <div id="container" class="clear"> 
	    	<div id="homepage">
  					<p:messages id="mensagem" for="mensagem" showDetail="true" autoUpdate="true"/>
  					
				
				<!-- ############################ DIALOG 1 ::  ESCOLHE PLANO RENOVAÇÃO  ############################ -->
				
				  <p:dialog id="definePlanoDialog" closable="false" header="Dados Contrato - Renovação" modal="true" style="background-color:#E0EEE0" 
			 		height="480" width="1090" widgetVar="dlgDefinePlano" resizable="false" showEffect="fade" hideEffect="fade" styleClass="disable-scroll">
					
			   		<div align="center">							
						<p:carousel id="crlPlanos" itemStyle="width:320px;height:410px;background-color:#{plano.corPanelPlano}" 
							value="#{planoMB.planoL}" headerText="" var="plano"> 
							<h:panelGrid columns="1" width="100%" style="text-align:center" cellpadding="5" columnClasses="label,value" styleClass="ui-panelgrid">
								<f:facet name="header">
									<h:outputText id="notificacaoPlanoVencidoutputText" value="#{plano.nomePlano}" style="color:#B0E2FF;font-size:30px;font-weight:bold;"/>
								</f:facet>
								<div align="center">
									<br/>
								    <h:outputText value="#{plano.beneficioQtdeCardapioS}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
									<h:outputText value="#{plano.beneficioQtdeFilialS}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
									<h:outputText value="#{plano.beneficioPeriodoAssinaturaS}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
									<h:outputText value="#{plano.beneficioTexto}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
					            	<br/>
					            </div>
							</h:panelGrid>
				
				           	<div align="center">
						       	<h:outputText value="#{plano.moeda}" style="color:838B8B;font-weight:bold;font-size:18px;"/>
								<h:outputText value="#{plano.valor}" style="color:blue;font-size:30px;font-weight:bold;"/>
								<h:outputText value="#{plano.periodicidadeTipoFormatado}" style="color:838B8B;font-weight:bold;font-size:18px;"/>
						        <br/>
						        <br/>
						        <br/>
							</div>

							<p:commandButton value="#{msgs.RenovarPlano}"  icon="ui-icon-addPagamento" oncomplete="PF('dlgDadosContratoRenovacao').show()">	
								   <f:setPropertyActionListener value="#{plano}" target="#{contratoMB.selectPlanoVO}" />
							</p:commandButton>					 
					  	</p:carousel>
					</div>
				</p:dialog>
				

				<!-- ############################ DIALOG 2 ::  DADOS CONTRATO - RENOVAÇÃO  ############################ -->
	    	    <p:dialog id="dadosContratoDialog" closable="false" header="Dados Contrato - Renovação" modal="true" style="background-color:#E0EEE0" 
			 		height="480" width="1090" widgetVar="dlgDadosContratoRenovacao" resizable="false" showEffect="fade" hideEffect="fade" styleClass="disable-scroll">

	        			<h:panelGrid columns="2" cellpadding="5" width="100%" id="panelDadosContrato"  columnClasses="gridCol1With1-3Col,gridCol1With1-2Col,gridCol3With1-3Col" styleClass="ui-panelgrid">
			            	<f:facet name="header">
								<h:outputText id="dadosEmpresaSedeText" value="#{msgs.dadosContrato}" />
			           	 	</f:facet>
			
			            	<p:outputLabel value="#{msgs.numeroContrato}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
			            	<p:outputLabel id="numeroContrato" value="#{contratoMB.contratoVO.numeroContrato}" style="color:#A52A2A;font-size:19px;font-weight:bold;"/>
						            	
			            	<h:outputLabel value="#{msgs.contratoEmNome}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
				           	<p:inputText id="contratoEmNome" size="30" value="#{contratoMB.contratoVO.contratoEmNome}" style="color:#483D8B;font-size:15px;" 
				           	 maxlength="40">
				           	</p:inputText>
	
			            	<p:outputLabel value="#{msgs.CNPJ}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
			            	<p:inputMask id="cnpj"  value="#{contratoMB.contratoVO.CNPJ}" style="color:#483D8B;font-size:15px;" 
			            	mask="99.999.999/9999-99" size="20" />
						            	
			            	<p:outputLabel value="#{msgs.InsEstadual}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
			            	<p:inputText id="insEstadual"  value="#{contratoMB.contratoVO.insEstadual}" style="color:#483D8B;font-size:15px;" 
			            	maxlength="20"/>
						            	
			            	<p:outputLabel value="#{msgs.contratoResponsavel}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
			            	<p:inputText id="nomeResponsavel" value="#{contratoMB.contratoVO.nomeResponsavel}" style="color:#483D8B;font-size:15px;"
			            	size="30" maxlength="50"/>
			           		
			            	<p:outputLabel value="#{msgs.contratoResponsavelCPF}" style="color:#483D8B;font-size:15px;font-weight:bold;"/>
			            	<p:inputMask id="cpf" value="#{contratoMB.contratoVO.cpf}" style="color:#483D8B;font-size:15px;" 
			            	mask="999.999.999-99" size="20"/>
	
						</h:panelGrid>
						
	        			<h:panelGrid columns="2" width="100%"   cellpadding="5" columnClasses="gridCol1With1-2Col,gridCol2With1-2Col" styleClass="ui-panelgrid">
							<f:facet name="header">
								<h:outputText id="restauranteFiliaisText" value="#{msgs.restaurantesFilialAssociados}" />
							</f:facet>
					               
				               <p:pickList id="filiaisAdmConta" value="#{contratoMB.empresaFiliaisL}"
		            			  var="restauranteFilialWeb"  effect="bounce" itemValue="#{restauranteFilialWeb}" itemLabel="#{restauranteFilialWeb}" style="width:50%;" 
		            			  converter="filialPickListConverter" styleClass="ui-picklist">
									 
										<f:facet name="sourceCaption">Restaurante/Filiais</f:facet>  
	        							<f:facet name="targetCaption">Associado Contrato</f:facet>  
	        
		 								 <p:ajax event="transfer" listener="#{contratoMB.onTransfer}" /> 
										 
										 <p:column style="width:60%;">  
										 <h:outputText value="#{restauranteFilialWeb.restauranteFilialJuridicoWeb.nomeFantasiaFilial}" />

	        							 </p:column>
								</p:pickList>
						</h:panelGrid>
						
						<f:facet name="footer">	  
			        			<p class="fl_left">
			        				<p:commandButton  value="#{msgs.Voltar}" icon="ui-icon-check" onclick="dlgDadosContratoRenovacao.hide();"/>
			        			</p>  
								<p class="fl_right">
									<p:commandButton value="#{msgs.Proximo}" icon="ui-icon-check" update="panelDadosContrato" 
									actionListener="#{contratoMB.validaDadosContratoRenovacao()}" />
								</p>
		    			</f:facet>
				</p:dialog>
				

   			
					    	
					    	
    			<!-- ############################ DIALOG 4 ::  FORMA PAGAMENTO - RENOVAÇÃO  ############################ -->
	    	    <p:dialog id="formaPagamentoDialog" closable="false" header="Forma Pagamento" modal="true" style="background-color:#E0EEE0" 
			 		height="530" width="1090" widgetVar="dlgFormaPagRenovacao" resizable="false" styleClass="disable-scroll">


					  <p:dataGrid var="formaPagamento" value="#{contratoMB.formaPagamentoL}" columns="3" layout="grid"
					        rows="12" paginator="true" id="formaPagto" rowsPerPageTemplate="6" style="height:50%; border:1px">
					 
					        <f:facet name="header">
					            MEIO DE PAGAMENTO
					        </f:facet>
					 
					        <p:panel header="#{formaPagamento.nomePagamento}" style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%;height:10%">
					                <p:graphicImage value="#{formaPagamento.imagem}" style="vertical-align: middle;" width="70" height="70"/> 
					 
					                <h:outputText value="#{formaPagamento.descricaoPagamento}" />

									<p:commandButton value="Pagar Agora" icon="ui-icon-addPagamento" action="#{contratoMB.loadDialogConfirmaPagamento()}"
									oncomplete="PF('dlgPagamentoRenovacao').show()" update=":form2:pagamentoDialog" >
										 <f:setPropertyActionListener value="#{formaPagamento}" target="#{contratoMB.selectFormaPagamento}" />
									</p:commandButton>					 
					            </h:panelGrid>
					        </p:panel>
					  </p:dataGrid>
					  
					<f:facet name="footer">	  
			        	<p class="fl_left">                                               
			        		<p:commandButton  value="#{msgs.Voltar}" icon="ui-icon-check" onclick="PF('dlgFormaPagRenovacao').hide()"/>
			        	</p>  
		    		</f:facet>	 		
					  
					  
				</p:dialog>
				
				
    			<!-- ############################ DIALOG 5 ::  PAGAMENTO - RENOVAÇÃO  ############################ -->
	    	    <p:dialog id="pagamentoDialog" closable="false" header="Pagamento Renovação" modal="true" style="background-color:#E0EEE0" 
			 		height="440" width="650" widgetVar="dlgPagamentoRenovacao" resizable="false" styleClass="disable-scroll" >
			 		
					 <p:panel id="pagCartaoCredito" header="Cartão Crédito"  style="margin-bottom:20px" rendered="#{contratoMB.statusCartaoCredito}">
					 	<h:panelGrid columns="2" cellpadding="5">
				        	<h:outputText value="#{msgs.tipoCartao}" />
				    	  	 <p:graphicImage value="#{contratoMB.cartaoCreditoImg}" style="vertical-align: top;" width="50" height="50" />

				    		<h:outputText value="#{msgs.nomeTitula}" />
				    		<p:inputText value="#{contratoMB.formaPagVO.titulaPagamento}" size="35"/>

				    		<h:outputText value="#{msgs.numeroCartao}" />
				    		<p:inputText value="#{contratoMB.formaPagVO.codeTransacao}">
  				    		</p:inputText>  
				    		
				    		<h:outputText value="#{msgs.codSegCartao}" />
				    		<p:inputMask  placeHolder="" value="#{contratoMB.formaPagVO.codSeguranca}" 
				    		maxlength="3" size="3">
				    		</p:inputMask>  
				    		  
				    		
				    		<h:outputText value="#{msgs.dataValidade}" />
				    		<h:panelGrid columns="3" cellpadding="5">
	 							<p:selectOneMenu id="mesCard" value="#{contratoMB.formaPagVO.mes}" style="width:150px">
					                <f:selectItem itemLabel="Select mês" itemValue="" noSelectionOption="true" />
	       							<f:selectItem itemLabel="01" itemValue="01" />
	       							<f:selectItem itemLabel="02" itemValue="02" />
	       							<f:selectItem itemLabel="03" itemValue="03" />
	       							<f:selectItem itemLabel="04" itemValue="04" />
	       							<f:selectItem itemLabel="05" itemValue="05" />
	       							<f:selectItem itemLabel="06" itemValue="06" />
	       							<f:selectItem itemLabel="07" itemValue="07" />
	       							<f:selectItem itemLabel="08" itemValue="08" />
	       							<f:selectItem itemLabel="09" itemValue="09" />
	       							<f:selectItem itemLabel="10" itemValue="10" />
	       							<f:selectItem itemLabel="11" itemValue="11" />
	       							<f:selectItem itemLabel="12" itemValue="12" />
	            				</p:selectOneMenu>
	            				
	 							<p:selectOneMenu id="anoCard" value="#{contratoMB.formaPagVO.ano}" style="width:150px">
					                <f:selectItem itemLabel="Select ano" itemValue="" noSelectionOption="true" />
	       							<f:selectItem itemLabel="2015" itemValue="2015" />
	       							<f:selectItem itemLabel="2016" itemValue="2016" />
	       							<f:selectItem itemLabel="2017" itemValue="2017" />
	       							<f:selectItem itemLabel="2018" itemValue="2018" />
	       							<f:selectItem itemLabel="2019" itemValue="2019" />
	       							<f:selectItem itemLabel="2020" itemValue="2020" />
	       							<f:selectItem itemLabel="2021" itemValue="2021" />
	       							<f:selectItem itemLabel="2022" itemValue="2022" />
	       							<f:selectItem itemLabel="2023" itemValue="2023" />
	       							<f:selectItem itemLabel="2024" itemValue="2024" />
	       							<f:selectItem itemLabel="2025" itemValue="2025" />
	       							<f:selectItem itemLabel="2026" itemValue="2026" />
	            				</p:selectOneMenu>
	            			</h:panelGrid>
	            		</h:panelGrid>	

			    		<h:outputText value="#{contratoMB.selectPlanoVO.nomePlano}" style="color:#EE0000;font-weight:bold;font-size:20px;"/>

   	            		<h:panelGrid columns="2" cellpadding="5" style="background-color:#FFF8DC" columnClasses="gridCol1With1-2Col,gridCol2With1-2Col" 
   	            		styleClass="ui-panelgrid">
				    		
            				<h:outputText value="#{msgs.planoValor}" style="color:#708090;font-weight:bold;font-size:17px;" />
			    			<h:outputText value="#{contratoMB.valorPlanoFormatado}" style="color:#A52A2A;font-weight:bold;font-size:20px;"/>
								
		           			<h:outputText value="#{msgs.planoDesconto}" style="color:#708090;font-weight:bold;font-size:17px;"/>
			    			<h:outputText value="#{contratoMB.descontoFormatado}" style="color:#483D8B;font-weight:bold;font-size:20px;" />

   
		           			<h:outputText value="" style="color:#EED2EE;font-weight:bold;font-size:17px;"/>
						    <h:selectOneMenu id="pagamentoTipo" value="#{contratoMB.numeroParcelaPagamento}">
						           	<f:selectItem itemLabel="Parcelamento Plano" itemValue=""/>
									<f:selectItems value="#{contratoMB.listaParcelaPagamentoL}" var="parcela" itemLabel="#{parcela.textoParcela}" 
											itemValue="#{parcela.numeroParcela}"/>  
							</h:selectOneMenu>
			
            				<h:outputText value="#{msgs.planoTotal}" style="color:#708090;font-weight:bold;font-size:20px;" />
			    			<h:outputText value="#{contratoMB.totalPagamentoFormatado}" style="color:black;font-weight:bold;font-size:20px;" /> 
	            		</h:panelGrid>
					 </p:panel>
					 
 					 <p:panel id="pagBoleto" header="Boleto Bancário" style="margin-bottom:20px" rendered="#{contratoMB.statusBoleto}">
					 	<h:panelGrid columns="2" cellpadding="10">
				        	<h:outputText value="#{msgs.tipoCartao}" />

					     </h:panelGrid>
					 </p:panel>
					 
  					 <p:panel id="pagPayPal" header="PayPal" style="margin-bottom:20px" rendered="#{contratoMB.statusPayPal}">
					 	<h:panelGrid columns="2" cellpadding="10">
				        	<h:outputText value="#{msgs.tipoCartao}" />

					     </h:panelGrid>
					 </p:panel>			 		
					 			 		
  					 <p:panel id="pagItau" header="Transferencia Itaú" style="margin-bottom:20px" rendered="#{contratoMB.statusItau}">
					 	<h:panelGrid columns="2" cellpadding="10">
				        	<h:outputText value="#{msgs.tipoCartao}" />

					     </h:panelGrid>
					 </p:panel>
					 
					 
					 <f:facet name="footer">	  
			        	<p class="fl_left">                                               
			        		<p:commandButton  value="#{msgs.Voltar}" icon="ui-icon-check" onclick="PF('dlgPagamentoRenovacao').hide()"/>
			        	</p>  
						<p class="fl_right">
							<p:commandButton value="#{msgs.ConfirmaPagamento}" icon="ui-icon-check" 
							actionListener="#{contratoMB.controleOperacaoPagamento()}"/>
						</p>
		    		</f:facet>	 		
				</p:dialog>
				
				
				
				<!-- ############################ DIALOG 5 ::  MENSAGEM CONFIRMAÇÃO OK  ############################ -->

				<p:confirmDialog message="#{msgs.msgSucessoRenovacao}"  showEffect="bounce" hideEffect="explode"  
			                header="Sucesso Renovação" severity="alert" widgetVar="dlgMsgInformativoRenovacaoOK">  
			                  
					<p:commandButton value="Login" action="#{contratoMB.redirecionaPaginaPortal()}"/>
			                  
			    </p:confirmDialog> 

				<!-- ############################ DIALOG 5 ::  MENSAGEM CONFIRMAÇÃO ERRROR  ############################ -->

				<p:confirmDialog message="#{msgs.msgErroRenovacao}"  showEffect="bounce" hideEffect="explode"  
			                header="Erro Renovação" severity="error" widgetVar="dlgMsgInformativoRenovacaoError">  
		        		<p:commandButton  value="#{msgs.ok}" icon="ui-icon-check" action="#{contratoMB.redirecionaPaginaPortal()}"/>
			    </p:confirmDialog> 
				
	  		</div>
	  	</div>
	</div>

	<!-- Copyright -->
	<div class="wrapper row4">
	  <footer id="copyright" class="clear">
	    <p class="fl_left">Copyright 2014 - All Rights Reserved - <a href="#">W7VM</a></p>
	    <p class="fl_right">W7VM <a href="http://www.w7vm.com/" title="Developer Application Mobile">Developer Application Mobile</a></p>
	  </footer>
	</div>
</h:form>
</h:body>
</html>